#include <bits/stdc++.h>
using namespace std;
int n,x,ans;
int s[100005];
signed main(){
	std::ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>x;
		s[x]++;
	}
	int cur=0;
	for(int i=1;i<=100000;i++){
		if(s[i]){
			int res=min(cur,s[i]);
			ans+=res;
			s[i]-=res;
		}
		cur+=s[i];
	}
	cout<<n-ans;
	return 0;
}